// ① 引入
import Vue from 'vue'
import VueRouter from 'vue-router'
import HomePage from '@/views/HomePage.vue'
import Classify from '@/views/Classify.vue'
import Order from '@/views/Order.vue'
import My from '@/views/My.vue'

// ② 调用 Vue.use() 去注册这个插件
Vue.use(VueRouter)

// ③ 创建路由实例
const router = new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/homepage',
    },
    {
      path: '/homepage',
      component: HomePage,
    },
    {
      path: '/Classify',
      component: Classify,
    },
    {
      path: '/Order',
      component: Order,
    },
    {
      path: '/My',
      component: My,
    },
  ],
})
// 对外暴露
export default router
